<?php

class Lib_Repair_Adapter
{

    private static $obj_arr = array();

    public static function create($pass)
    {
        if (!array_key_exists($pass, self::$obj_arr) || is_null(self::$obj_arr[$pass])) {
            $class_name = 'Lib_Repair_Adapter_' . ucfirst($pass);
            if (!class_exists($class_name)) {
                throw new Exception('sms pass configuration error!', 4004);
            }
            self::$obj_arr[$pass] = new $class_name();
        }
        return self::$obj_arr[$pass];
    }

    public static function getAdapter($pass)
    {
        $pass_obj = self::create($pass);
        return $pass_obj;
    }


}